package com.ezcolour.ticket.admin.controller;

import com.ezcolour.ticket.base.BaseController;
import com.ezcolour.ticket.common.shiro.ShiroKit;
import com.ezcolour.ticket.model.User;
import com.ezcolour.ticket.service.UserService;
import com.ezcolour.ticket.service.VocalBeanService;
import com.ezcolour.ticket.util.ToolUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/admin")
public class OrderController extends BaseController {

    @Autowired
    private VocalBeanService vocalBeanService;

    /**
     * 跳转到订单管理页面
     */
    @RequestMapping(value = "/order", method = RequestMethod.GET)
    public String getOrders(Model model) {
        model.addAttribute("orderList", vocalBeanService.findAll());
        return  "/admin/order";
        
    }

    /**
     * 开始
     */
    @ResponseBody
    @RequestMapping(value = "/start", method = RequestMethod.POST)
    public String order(User user) {

        return REDIRECT + ADMINPREFIX+ "/center";

    }
}
